import React from 'react'
import { useEffect } from 'react'
import {getLogin,getAdd,getEdit,getDel} from "../api/index"
export default function Home() {
  useEffect(()=>{
    getLogin().then((res)=>{
      console.log(res.data)
    })
  },[])
  return (
    <div>Home
      <button onClick={()=>{
        getAdd({userName:"zzm",password:"123"}).then((res)=>{
          console.log(res)
        })
      }}>添加</button>
      <button onClick={()=>{
        getEdit({id:3,userName:"1111"})
      }}>修改</button>
      <button onClick={()=>{
        getDel({id:3})
      }}>删除</button>
    </div>
  )
}
